feat: add reasoning content toggle for assistant messages#2809
Open
dasolhwang wants to merge 1 commit intosimstudioai:mainfrom
Open
feat: add reasoning content toggle for assistant messages#2809dasolhwang wants to merge 1 commit intosimstudioai:mainfrom
dasolhwang wants to merge 1 commit intosimstudioai:mainfrom
Conversation
Add toggleable reasoning_content field for assistant role messages in the Agent block's messages input component. Features: - Added reasoning_content optional field to Message interface - Added '+ Reasoning' / '− Reasoning' toggle button for assistant messages - Reasoning content field appears/hides based on toggle state - Auto-shows reasoning content when existing data contains reasoning_content - Full support for variable references, env vars, and all existing features - Maintains clean UI by showing field only when needed This enables users to add reasoning/thinking content separately from the main response content, useful for: - o1/o3 models with reasoning capabilities - Few-shot learning examples with chain-of-thought - Debugging and transparency in agent responses
|
Someone is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile SummaryAdds an optional
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant MessagesInput
participant State
participant Message
User->>MessagesInput: Click "+ Reasoning" button
MessagesInput->>State: toggleReasoningContent(index)
State->>State: Update showReasoningContent[index] = true
MessagesInput->>MessagesInput: Re-render with reasoning field visible
User->>MessagesInput: Enter reasoning content
MessagesInput->>Message: updateMessageReasoningContent(index, content)
Message->>Message: Update message.reasoning_content
Message->>State: setMessages(updatedMessages)
User->>MessagesInput: Click "− Reasoning" button
MessagesInput->>State: toggleReasoningContent(index)
State->>State: Update showReasoningContent[index] = false
Note over State,Message: reasoning_content data preserved
MessagesInput->>MessagesInput: Re-render with reasoning field hidden
|
Contributor
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Overview
Adds a toggleable reasoning_content field for assistant role messages in the Agent block's messages input component.
✨ Features
🎬 Use Cases
📝 Implementation Details
Modified File:
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/messages-input/messages-input.tsxChanges:
reasoning_content?: stringto Message interfaceCode Statistics:
✅ Testing
Tested locally with development server. All existing functionality preserved.
🔗 Related
This feature enables better support for reasoning models like OpenAI's o1/o3 series, which separate thinking/reasoning from response content.